<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/25
  Time: 14:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div id="page-content">
  <div class="row">

    <div class="col-lg-12">
      <div class="panel">
        <div class="panel-heading">
          <h3 class="panel-title">员工生日一览</h3>
        </div>
        <div class="panel-body">
          <div class="form-inline">
            <div class="row">
              <div class="col-sm-12 table-toolbar-left">
                <%--<btn id="btn_add_birthday" class="btn btn-primary btn-sm">--%>
                  <%--<i class="ti-plus"> </i> 新建人事信息表--%>
                <%--</btn>--%>
              </div>
            </div>
          </div>

          <div class="table-responsive">
            <table id="birthday_out_table"></table>
            <div id="birthday_out_page"></div>
          </div>
        </div>
      </div>
    </div>

  </div>
</div>

<script>

  $(function(){

    init_grid_birthday();

  });

  function init_grid_birthday() {

    __init_jqgrid('birthday_out_table', 'birthday_out_page',
            '<%=path%>/com/personnelInfo/list',
            ['月份','用工性质','生日', '姓名', '年龄', '性别', '所属部门', '岗位', 'id'],
            [
              {name: 'month', index: 'month',width: 80,sortable: true, search:true, stype: 'text', searchoptions: {sopt: ['cn']}},
              {name: 'nature', index: 'nature', width: 80, sortable: true, search: true, searchoptions: {sopt: ['cn']}},
              {name: 'birthday', index: 'birthday',width: 80, sortable: true, search:true, stype: 'text', searchoptions: {sopt: ['cn']}},
              {name: 'name', index: 'name', sortable: true,search:true,width: 100, stype: 'text', searchoptions: {sopt: ['cn']}},
              {name: 'age', index: 'age', width: 60, sortable: true, search: true, searchoptions: {sopt: ['cn']}},
              {name: 'sex', index: 'sex', width: 60, sortable: true, search: true, searchoptions: {sopt: ['cn']}},
              {name: 'department', index: 'department', width: 100, sortable: true, search: true, searchoptions: {sopt: ['cn']}},
              {name: 'post', index: 'post', width: 100, sortable: true, search: true, searchoptions: {sopt: ['cn']}},
              {name: 'id', index: 'id', width: 100, key: true, hidden: true, hidedlg: true}
            ],
            true,true
    );

  }

  function useTypeFormat(cellvalue, options, rowObject){
    if(rowObject.nature == 1){
      cellvalue = "正式员工";
    } else if(rowObject.nature == 2){
      cellvalue = "试用员工";
    }else{
      cellvalue = "暂无";
    }
    return cellvalue;
  }

</script>